Follow the installation directions found here:
https://github.com/catherinekuhn/CloudtoStreet/blob/master/Python%20API%20directions.ipynb
Make sure that you are in the correct environment. To check your current environment, type the following. The environment you are in will have a star next to it.
conda info --envs
If you are not in the ee-python environment, you can switch into it using
source activate ee-python
In [3]:
# Import the Earth Engine Python Package into Python environment.
import ee
import ee.mapclient
# Initialize the Earth Engine object, using the authentication credentials.
ee.Initialize()
In [4]:
image = ee.Image('srtm90_v4')
from IPython.display import Image
Image(url=image.getThumbUrl({'min':0, 'max': 3000}))
Out[4]:
In [5]:
# Print the information for an image asset. the 'srtm90_v4 file is a digital elevation model.
# that is housed in Google's cloud and has an elevation value for every pixel across the whole earth
# at a resolution of 30 meters. That is the map you see below in the static notebook.
print(image.getInfo())
#celebrate the metadata!!
In [6]:
Irene= ee.Image("users/kuhniculous/floodwithnoletters")
from IPython.display import display,Image
test=ee.Image(Irene)
display(Image(url=test.select(['b1']).getThumbUrl({'gamma':2})))
Lparams = {
'min':0.0134,
'max':0.0338,
'palette':'000000,0000ff,00ffff,00ff00,ffff00,ffa500,ff0000',
};
display(Image(url=test.select(["b1"]).getThumbUrl(Lparams)))
In [7]:
Irene= ee.Image("users/kuhniculous/popImage")
from IPython.display import display,Image
test=ee.Image(Irene)
display(Image(url=test.select(['b1']).getThumbUrl({'gamma':2})))
Lparams = {
'min':7,
'max':7.5,
'palette':'000000,ff0000',
};
display(Image(url=test.select(["b1"]).getThumbUrl(Lparams)))
This code will run but then nothing happens. I have no idea why!
In [10]:
"""Select rows from a fusion table."""
import ee
import ee.mapclient
ee.Initialize()
ee.mapclient.centerMap(-93, 40, 4)
# Select the 'Sonoran desert' feature from the TNC Ecoregions fusion table.
fc = (ee.FeatureCollection('ft:1Ec8IWsP8asxN-ywSqgXWMuBaxI6pPaeh6hC64lA')
.filter(ee.Filter().eq('ECO_NAME', 'Sonoran desert')))
# Paint it into a blank image.
image1 = ee.Image(0).mask(0)
ee.mapclient.addToMap(image1.paint(fc, 0, 5))
In [11]:
%matplotlib inline
from __future__ import print_function # For py 2.7 compat
import datetime
from IPython.html import widgets
from IPython.display import display
from IPython.utils import traitlets
from IPython.core.display import Javascript
In [12]:
%run 'define_google_maps_interactive_widget.ipynb'
In [13]:
Irene= ee.Image("users/kuhniculous/popImage")
In [14]:
map = GoogleMapsWidget(lat=59.5, lng=10.9, zoom=13) # lat, lng and zoom are optional
display(map)
map.addLayer(Irene, {'color': 'FFFFCC'}, name='Irene Map')